<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>insremot</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="ins.html" title="ins" />
    <link rel="next" href="insglobal.html" title="insglobal" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">insremot</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="ins.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="insglobal.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="insremot"></a>
      <div class="titlepage"></div>
      <a id="Indexinsremot" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">insremot</span>
        </h2>
        <p>insremot — 
      An opcode which can be used to implement a remote
      orchestra. This opcode will send note events from a source
      machine to one destination. 
    </p>
      </div>
      <div class="refsect1">
        <a id="idp116737936"></a>
        <h2>Description</h2>
        <p>
      With the <span class="emphasis"><em>insremot</em></span> and <a class="link" href="insglobal.html" title="insglobal"><em class="citetitle">insglobal</em></a>
      opcodes you are able to perform instruments on remote machines
      and control them from a master machine. The remote opcodes are
      implemented using the master/client model. All the machines
      involved contain the same orchestra but only the master machine
      contains the information of the score. During the performance
      the master machine sends the note events to the clients. The
      <span class="emphasis"><em>insremot</em></span> opcode will send events from a
      source machine to one destination if you want to send events to
      many destinations (broadcast) use the <a class="link" href="insglobal.html" title="insglobal"><em class="citetitle">insglobal</em></a>
      opcode instead. These two opcodes can be used in combination.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp116808704"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>insremot</strong></span> idestination, isource, instrnum [,instrnum...] </pre>
      </div>
      <div class="refsect1">
        <a id="idp116810784"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>idestination</em></span>
      -- a string that is the intended client computer (e.g. 192.168.0.100). This is the destination host which receives the events from the given instrument.
    </p>
        <p>
      <span class="emphasis"><em>isource</em></span>
      -- a string that is the intended server computer (e.g. 192.168.0.100). This is the source host which generates the events of the given instrument and sends it to the address given by idestination.
    </p>
        <p>
      <span class="emphasis"><em>instrnum</em></span>
      -- a list of instrument numbers which will be played on the destination machine
    </p>
      </div>
      <div class="refsect1">
        <a id="idp116814496"></a>
        <h2>Performance</h2>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
      If is essential the computers using this opcode have the same
      byte-order, data size (double or float) and pointer size.  One
      cannot use it with mixed 32 and 64 computers for instance.
    </td>
            </tr>
          </table>
        </div>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
      Internally this opcode may make use of the gethostname and
      gethostbyname functions to determine the client's and server's
      IP address for checking which messages are for which machine, or
      on non-windows system other techniques.
      If a computer has more than one IP address there is no way to
      control which IP address is found (but see below).  On
      non-windows systems the default network is eth0 or en0, and if
      that fails wlan0.  (Since version 6.05) the network to be used
      can be set with an environment variable CS_ETHER. 
    </td>
            </tr>
          </table>
        </div>
        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
          <table border="0" summary="Note">
            <tr>
              <td rowspan="2" align="center" valign="top" width="25">
                <img alt="[Note]" src="images/note.png" />
              </td>
              <th align="left">Note</th>
            </tr>
            <tr>
              <td align="left" valign="top">
      The remote operation does not allow the sending of strings at
      all.
    </td>
            </tr>
          </table>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp116817360"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the insremot opcode. It uses the files <a class="ulink" href="examples/insremot.csd" target="_top"><em class="citetitle">insremot.csd</em></a> and <a class="ulink" href="examples/insremotM.csd" target="_top"><em class="citetitle">insremotM.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp116819984"></a>
          <p class="title">
            <strong>Example 400. Example of the insremot opcode.</strong>
          </p>
          <div class="example-contents">
            <p>The simple example below shows the bilbar example played on a remote machine. The master machine is named "192.168.1.100" and the client "192.168.1.101". Start the client on the machine (it will wait to receive the events from the master machine) and then start the master. Here is the command on linux to start a client (csound -+rtaudio=alsa -odac -dm0 insremot.csd), and the command on the master machine will look like this (csound -+rtaudio=alsa -odac -dm0 insremotM.csd).</p>
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in</span>
-odac           -iadc     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o insremot.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="opc">insremot</span> "192.168.1.100", "192.168.1.101", 1

<span class="oblock">instr</span> 1
  aq <span class="opc">barmodel</span> 1, 1, p4, 0.001, 0.23, 5, p5, p6, p7
     <span class="opc">out</span>      aq
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span>0 360

<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
<span class="comment">; Audio out   Audio in</span>
-odac           -iadc     <span class="comment">;;;RT audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o insremotM.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">nchnls</span> <span class="op">=</span> 1

<span class="opc">insremot</span> "192.168.1.100", "192.168.1.101", 1

<span class="oblock">instr</span> 1
  aq <span class="opc">barmodel</span> 1, 1, p4, 0.001, 0.23, 5, p5, p6, p7
     <span class="opc">out</span>      aq
<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">i</span>1 0 0.5 3 0.2 500 0.05
<span class="stamnt">i</span>1 0.5 0.5 -3 0.3 1000 0.05
<span class="stamnt">i</span>1 1.0 0.5 -3 0.4 1000 0.1
<span class="stamnt">i</span>1 1.5 4.0 -3 0.5 800 0.05
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp116826416"></a>
        <h2>See also</h2>
        <p>
      <a class="link" href="insglobal.html" title="insglobal"><em class="citetitle">insglobal</em></a>, <a class="link" href="midglobal.html" title="midglobal"><em class="citetitle">midglobal</em></a>, <a class="link" href="midremot.html" title="midremot"><em class="citetitle">midremot</em></a>, <a class="link" href="remoteport.html" title="remoteport"><em class="citetitle">remoteport</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp116831248"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Simon Schampijer</td>
          </tr>
          <tr>
            <td>2006</td>
          </tr>
        </table>
        <p>
    </p>
        <p>
      New in version 5.03
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="ins.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="insglobal.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">ins </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> insglobal</td>
        </tr>
      </table>
    </div>
  </body>
</html>
